package com.chl.sort.other;

/**
 * 插入排序
 * 
 * @author 陈宏亮
 *
 */
public class Sort03Insert {
	public static void sort(int[] arrs) {
		int i, j, l = arrs.length;
		int tmp;
		for (i = 1; i < l; i++) {
			tmp = arrs[i];
			for (j = i; j > 0 && arrs[j - 1] > tmp; j--) {
				arrs[j] = arrs[j - 1];
			}
			arrs[j] = tmp;
		}
	}
}
